<template>
<div class="list-group">
<div class="list-group-item">
<button type="button" class="vue-btn vue-btn-default block" @click="showAlert">Confirm</button>
</div>
<Confirm 
:visible.sync="confirm.visible"
:title="confirm.title"
:content="confirm.content"
@ok="onOk"
@cancel="onCancel"
></Confirm>
</div>
</template>

<script>
import Confirm from "components/message/confirm"

export default{
	components:{
 		Confirm
 	},
 	data(){
 		var self=this;
 		return{
	 		"confirm":{
	 			visible:false,
	 			title:"ConfirmTitle",
	 			content:"这是一个Confrim弹出框。"
	 		}
 		}
 	},
 	methods:{
 		showAlert:function(){
 			this.confirm.visible=true;
 		},
		onOk:function(ev){
			alert("ok")
 		},
 		onCancel:function(ev){
			alert("cancel")
 		}
 	}
}
</script>